Skip to content

ci: harden workflows for zizmor (pin actions, fix template injection) - #751

Open
sanskar singh bhardwaj (sanskar-singh-2403) wants to merge 1 commit into
agent-substrate:mainfrom
sanskar-singh-2403:ci/pin-workflow-actions
Open

ci: harden workflows for zizmor (pin actions, fix template injection)#751
sanskar singh bhardwaj (sanskar-singh-2403) wants to merge 1 commit into
agent-substrate:mainfrom
sanskar-singh-2403:ci/pin-workflow-actions

Conversation

@sanskar-singh-2403

@sanskar-singh-2403 sanskar singh bhardwaj (sanskar-singh-2403) commented Aug 5, 2026

Copy link
Copy Markdown

What this PR does / why we need it

The zizmor gate has two mandatory checks failing on the workflow files:
unpinned-uses and template-injection. This PR resolves both.

  1. Pin every GitHub Actions uses: reference to a full commit SHA, keeping
    the semver in a trailing comment for readability and Dependabot:

    • actions/checkout@v5 -> fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09 (v5.1.0)
    • actions/setup-go@v5 -> 40f1582b2485089dde7abd97c1529aa768e1baff (v5.6.0)
    • actions/cache@v4 -> 0057852bfaa89a56745cba8c7296529d2fc39830 (v4.3.0)
    • golang/govulncheck-action@v1 -> 032d45514ae346b1db93c04b0c90b841c370344f (v1.1.0)
  2. Fix template injection in pr-workflow.yaml: ${{ matrix.auth-mode }} and
    ${{ needs.e2e-test-matrix.result }} were interpolated directly into run:
    shell blocks. Move each into an env: var and reference it as a quoted
    shell variable so the expansion cannot inject code.

No functional behavior change.

Testing

  • Ran zizmor --persona=pedantic on both workflow files: zero findings for any
    mandatory check (unpinned-uses, template-injection, etc.).
  • Confirmed both workflows remain valid YAML.

@sanskar-singh-2403 sanskar singh bhardwaj (sanskar-singh-2403) changed the title ci: pin workflow actions to commit SHAs (zizmor unpinned-uses) ci: harden workflows for zizmor (pin actions, fix template injection) Aug 5, 2026
@sanskar-singh-2403
sanskar singh bhardwaj (sanskar-singh-2403) force-pushed the ci/pin-workflow-actions branch 2 times, most recently from 7a0b049 to 7263854 Compare August 5, 2026 05:26
@BenTheElder

Copy link
Copy Markdown
Collaborator

@sanskar-singh-2403

Copy link
Copy Markdown
Author

isn't most of this https://github.com/agent-substrate/substrate/pull/657/changes?

I'll rebase

agent-substrate#657 already pinned the actions in pr-workflow.yaml and scoped the token
to contents: read, so this trims to just the zizmor findings that landing
did not cover.

- govulncheck.yaml: pin golang/govulncheck-action@v1 to
  032d45514ae346b1db93c04b0c90b841c370344f (v1.1.0), the only remaining
  unpinned-uses finding.
- pr-workflow.yaml: fix template-injection. Move
  ${{ matrix.ateapi-client-auth }} (Install / Deploy micro-VM steps) and
  ${{ needs.e2e-test-matrix.result }} (Check E2E matrix step) into env:
  vars and reference them as quoted shell variables so the expansion
  cannot inject code.

Verified with zizmor v1.29.0: zero unpinned-uses and zero
template-injection findings on both workflows. No functional change.
@sanskar-singh-2403

Copy link
Copy Markdown
Author

Benjamin Elder (@BenTheElder) I've reset onto current main and trimmed this down to just the findings #657
didn't cover:

  • govulncheck.yaml: pin golang/govulncheck-action@v1 to a SHA (the only
    remaining unpinned-uses).
  • pr-workflow.yaml template-injection: move ${{ matrix.ateapi-client-auth }}
    (Install / Deploy steps) and ${{ needs.e2e-test-matrix.result }} (Check E2E
    matrix step) into env: vars referenced as quoted shell variables.

Verified with zizmor: zero unpinned-uses and zero template-injection findings.
Force-pushed the trimmed version. Thanks for the pointer to #657.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants